package mall.service;

import java.util.List;

import mall.dao.MemberDAO;
import mall.pojo.Member;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class MemberServiceImpl implements MemberService {

	@Autowired
	private MemberDAO memberDAO;
	
	@Override
	@Transactional
	public void createMember(Member member) {
		memberDAO.createMember(member);
	}

	@Override
	@Transactional
	public Member checkLogin(String userName, String passWord) {
		return memberDAO.checkLogin(userName, passWord);
	}

	@Override
	@Transactional
	public boolean checkUserNameExist(String userName) {
		return memberDAO.checkUserNameExist(userName);
	}

	@Override
	@Transactional
	public List<Member> getListMember() {
		return (List<Member>)memberDAO.getListMember();
	}

	@Override
	@Transactional
	public Member getMember(int memberId) {
		return memberDAO.getMember(memberId);
	}

	@Override
	@Transactional
	public int updateMember(Member member) {
		return memberDAO.updateMember(member);
	}

}
